﻿using Prism.DryIoc;
using Prism.Ioc;
using Prism.Modularity;
using System.Configuration;
using System.Data;
using System.Windows;
using PMS.Client.BLL;
using PMS.Client.DAL;
using PMS.Client.Entities;
using PMS.Client.IBLL;
using PMS.Client.IDAL;
using PMS.Client.Start.Views;

namespace PMS.Client.Start
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : PrismApplication
    {
        protected override Window CreateShell()
        {
            return Container.Resolve<MainView>();
        }

        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterSingleton<GlobalValues>();

            containerRegistry.RegisterDialogWindow<DialogWindow>();
            containerRegistry.RegisterDialog<LoginView>();


            containerRegistry.Register<IUserService, UserService>();
            containerRegistry.Register<IFileService, FileService>();
            containerRegistry.Register<IMenuService, MenuService>();
            containerRegistry.Register<IRoleService, RoleService>();
            containerRegistry.Register<IBaseInfoService, BaseInfoService>();
            containerRegistry.Register<IOwnerService, OwnerService>();
            containerRegistry.Register<IFeeService, FeeService>();
            containerRegistry.Register<IOrderService, OrderService>();
            containerRegistry.Register<IFinanceService, FinanceService>();


            containerRegistry.Register<IUserAccess, UserAccess>();
            containerRegistry.Register<IFileAccess, FileAccess>();
            containerRegistry.Register<IMenuAccess, MenuAccess>();
            containerRegistry.Register<IRoleAccess, RoleAccess>();
            containerRegistry.Register<IBaseInfoAccess, BaseInfoAccess>();
            containerRegistry.Register<IOwnerAccess, OwnerAccess>();
            containerRegistry.Register<IFeeAccess, FeeAccess>();
            containerRegistry.Register<IOrderAccess, OrderAccess>();
            containerRegistry.Register<IFinanceAccess, FinanceAccess>();
        }

        protected override IModuleCatalog CreateModuleCatalog()
        {
            return new DirectoryModuleCatalog
            {
                ModulePath = Environment.CurrentDirectory + "\\Modules"
            };
            //return base.CreateModuleCatalog();
        }
    }

}
